//
//  AXHomeNcpscThirdCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/10/22.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import "AXHomeNcpscThirdCell.h"


@implementation AXHomeNcpscThirdCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    
    self.leftImgView = [[UIImageView alloc]init];
    self.leftImgView.userInteractionEnabled = YES;
    self.leftImgView.contentMode =UIViewContentModeScaleAspectFill;
    self.leftImgView.clipsToBounds=YES;//
    self.leftImgView .image = [UIImage imageNamed:@"ptsfx"];
    [self.contentView addSubview:self.leftImgView ];
    
    UITapGestureRecognizer *leftTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(leftTap:)];
    [self.leftImgView addGestureRecognizer:leftTap];
    
    
    self.rightOneImgView = [[UIImageView alloc]init];
    self.rightOneImgView.userInteractionEnabled = YES;
    self.rightOneImgView.contentMode =UIViewContentModeScaleAspectFill;
    self.rightOneImgView.clipsToBounds=YES;//
    self.rightOneImgView .image = [UIImage imageNamed:@"cm"];
    [self.contentView addSubview:self.rightOneImgView  ];
    
    UITapGestureRecognizer *rightOneTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rightOneTap:)];
    [self.rightOneImgView addGestureRecognizer:rightOneTap];
    
    
    self.rightTwoImgView = [[UIImageView alloc]init];
    self.rightTwoImgView.userInteractionEnabled = YES;
    self.rightTwoImgView.contentMode =UIViewContentModeScaleAspectFill;
    self.rightTwoImgView.clipsToBounds=YES;//
    self.rightTwoImgView .image = [UIImage imageNamed:@"xg"];
    [self.contentView addSubview:self.rightTwoImgView  ];
    
    UITapGestureRecognizer *rightTwoTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rightTwoTap:)];
    [self.rightTwoImgView addGestureRecognizer:rightTwoTap];
    
}

- (void)setlayout {
    
    self.leftImgView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(139)
    .heightIs(118);
    
    self.rightOneImgView.sd_layout
    .rightSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(SCREEN_WIDTH -169)
    .heightIs(54);
    
    self.rightTwoImgView.sd_layout
    .rightSpaceToView(self.contentView, 10)
    .topSpaceToView(self.rightOneImgView, 10)
    .widthRatioToView(self.rightOneImgView, 1)
    .heightRatioToView(self.rightOneImgView, 1);
    
    
    
}


- (void)leftTap:(UITapGestureRecognizer *)tap {
    
    if (self.tapButtonClickedBlock) {
        
        self.tapButtonClickedBlock(tap.view.tag);
    }
}

- (void)rightOneTap:(UITapGestureRecognizer *)tap {
    
    if (self.tapButtonClickedBlock) {
        
        self.tapButtonClickedBlock(tap.view.tag);
    }
}

- (void)rightTwoTap:(UITapGestureRecognizer *)tap {
    
    if (self.tapButtonClickedBlock) {
        
        self.tapButtonClickedBlock(tap.view.tag);
    }
}



@end
